<?php

function get_web_file($url)
{
    $http_opts = array('user_agent' => 'php file_get_contents');
    if (defined('HTTP_PROXY')) {
        if (!defined('HTTP_PROXY_EXCEPT') || strpos($url, 'http://'.HTTP_PROXY_EXCEPT) === false) {
            $http_opts['proxy'] = HTTP_PROXY;
        }
    }
    $context = stream_context_create(array('http' => $http_opts));
    return file_get_contents($url, false, $context);
}